package com.xyz.service;

import com.free.common.vo.ResultModel;
import com.free.ext.mybatis.model.entity.PageResponseModel;
import com.xyz.dao.logic.CCustomerInfoLogic;
import com.xyz.domain.table.CCustomerinfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CustomerInfoService extends BaseService{

    @Autowired
    CCustomerInfoLogic customerInfoLogic;

    /**
     * 使用模板插入用户数据
     * @param custId
     * @param category
     * @return
     */
    public ResultModel insertCustInfoByTmep(Integer custId, String category){
        Integer res = customerInfoLogic.insertCustInfoByTmep(custId, category);
        if(res > 0){
            return ResultModel.success();
        }
        return ResultModel.failure();
    }

    /**
     * 信息列表
     * @param pageNo
     * @param pageSize
     * @return
     */
    public PageResponseModel<CCustomerinfo> messageList(Integer pageNo, Integer pageSize){
        CCustomerinfo customerinfo = new CCustomerinfo();
        customerinfo.setCustomerId(getCurrentUser().getId());
        return customerInfoLogic.selectPageList(customerinfo, pageNo, pageSize);
    }

    
}
